const Koa = require('koa')
const bodyParser = require('koa-bodyparser')({
  jsonLimit: '50mb',
  formLimit: '50mb',
  textLimit: '50mb'
})
const Router = require('koa2-router')
const cors = require('koa2-cors')

const app = new Koa()
const router = new Router()

app.use(bodyParser)

app.use(cors({
  origin: function(ctx) {
    return '*'
  }
}))

app.use(router)

module.exports = {
  app,
  router
}
